﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class PlatForm_ExpertGainDetail : PX.MyPage
{
	private PX.ExpertGain.Component clsExpertComp = new PX.ExpertGain.Component();

	protected void Page_Load(object sender, EventArgs e)
	{
		if (!IsPostBack)
		{
			Show();
		}
	}

	protected override void OnInit(EventArgs e)
	{
		base.OnInit(e);

		clsExpertComp.page = Page;
	}

	/// <summary>
	/// 显示大师成果详细信息
	/// </summary>
	private void Show()
	{
		int nExpertGainID;
		PX.ExpertGain.Entity clsExpertGain = new PX.ExpertGain.Entity();
		PX.Expert.Expert clsExpert = new PX.Expert.Expert();
		PX.Expert.ExpertComponent clsComp = new PX.Expert.ExpertComponent();

		clsComp.page = Page;

		nExpertGainID = Convert.ToInt32(Request["ExpertGainID"]);
		clsExpertGain = clsExpertComp.QueryOneByID(nExpertGainID);

		clsExpert = clsComp.QueryByUserID(clsExpertGain.ExpertUserID);

		ExpertName.Text = clsExpert.Job + clsExpert.TypeName + clsExpertGain.ExpertName;
		GainName.Text = clsExpertGain.Name;
		TBExpertGainContnt.Text = "    " + clsExpertGain.Content;
		if (clsExpertGain.ImageID != 0)
		{
			ImgExpertGainPic.ImageUrl = "~/ShowImage.aspx?FileID=" + clsExpertGain.ImageID.ToString();
		}
		else
		{
			ImgExpertGainPic.Visible = false;
		}
		if (clsExpertGain.FileContentID != 0)
		{
			TBExpertGainContnt.Visible = false;
			idContent.Attributes.Add("src", "../ShowImageFile.aspx?FileID=" + clsExpertGain.FileContentID.ToString());
			idContent.Attributes.Add("onload", "iFrameHeight('" + idContent.ClientID.ToString() + "')");
		}
		else
		{
			TBExpertGainContnt.Visible = true;
		}
	}
}